package yxk.wtc.wtp.opplugin;

import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.validate.AbstractValidator;
import kd.hr.hbp.opplugin.web.HRDataBaseOp;
import kd.wtc.wtp.opplugin.web.attfile.validator.AttFileBaseModifyValidator;

import java.util.List;

/**
 * 考勤档案修改临时扩展插件
 *
 * @author rd_nengkang_hu
 * @since 2023-10-30
 */
public class AttFileBaseModifyExpandOp extends HRDataBaseOp {

    @Override
    public void onAddValidators(AddValidatorsEventArgs validatorsEventArgs) {
        List<AbstractValidator> validators = validatorsEventArgs.getValidators();
        validators.removeIf(AttFileBaseModifyValidator.class::isInstance);
        validators.add(new AttFileBaseModifyExpandValidator());
    }
}
